|
usbcpower2 2.2.0
|
API for configuring and manipulating USB-C Power 2 Click driver. More...
Topics | |
| USB-C Power 2 Registers List | |
| List of registers of USB-C Power 2 Click driver. | |
| USB-C Power 2 Registers Settings | |
| Settings for registers of USB-C Power 2 Click driver. | |
| USB-C Power 2 MikroBUS Map | |
| MikroBUS pin mapping of USB-C Power 2 Click driver. | |
Functions | |
| void | usbcpower2_cfg_setup (usbcpower2_cfg_t *cfg) |
| USB-C Power 2 configuration object setup function. | |
| err_t | usbcpower2_init (usbcpower2_t *ctx, usbcpower2_cfg_t *cfg) |
| USB-C Power 2 initialization function. | |
| err_t | usbcpower2_default_cfg (usbcpower2_t *ctx) |
| USB-C Power 2 default configuration function. | |
| err_t | usbcpower2_write_reg (usbcpower2_t *ctx, uint8_t reg, uint8_t data_in) |
| USB-C Power 2 write register function. | |
| err_t | usbcpower2_read_reg (usbcpower2_t *ctx, uint8_t reg, uint8_t *data_out) |
| USB-C Power 2 read register function. | |
| uint8_t | usbcpower2_get_id_pin (usbcpower2_t *ctx) |
| USB-C Power 2 get ID pin function. | |
| uint8_t | usbcpower2_get_int_pin (usbcpower2_t *ctx) |
| USB-C Power 2 get INT pin function. | |
| err_t | usbcpower2_check_com (usbcpower2_t *ctx) |
| USB-C Power 2 communication check function. | |
API for configuring and manipulating USB-C Power 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void usbcpower2_cfg_setup | ( | usbcpower2_cfg_t * | cfg | ) |
USB-C Power 2 configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See usbcpower2_cfg_t object definition for detailed explanation. |
| err_t usbcpower2_check_com | ( | usbcpower2_t * | ctx | ) |
USB-C Power 2 communication check function.
This function checks communication with the device by reading the vendor ID register and validating the returned value.
| [in] | ctx | : Click context object. See usbcpower2_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t usbcpower2_default_cfg | ( | usbcpower2_t * | ctx | ) |
USB-C Power 2 default configuration function.
This function executes a default configuration of USB-C Power 2 Click board.
| [in] | ctx | : Click context object. See usbcpower2_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | uint8_t usbcpower2_get_id_pin | ( | usbcpower2_t * | ctx | ) |
USB-C Power 2 get ID pin function.
This function reads and returns the logic state of the ID pin.
| [in] | ctx | : Click context object. See usbcpower2_t object definition for detailed explanation. |
| uint8_t usbcpower2_get_int_pin | ( | usbcpower2_t * | ctx | ) |
USB-C Power 2 get INT pin function.
This function reads and returns the logic state of the INT pin.
| [in] | ctx | : Click context object. See usbcpower2_t object definition for detailed explanation. |
| err_t usbcpower2_init | ( | usbcpower2_t * | ctx, |
| usbcpower2_cfg_t * | cfg ) |
USB-C Power 2 initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See usbcpower2_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See usbcpower2_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t usbcpower2_read_reg | ( | usbcpower2_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t * | data_out ) |
USB-C Power 2 read register function.
This function reads a single byte of data from the selected readable register address.
| [in] | ctx | : Click context object. See usbcpower2_t object definition for detailed explanation. |
| [in] | reg | : Readable register address. |
| [out] | data_out | : Output data byte. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t usbcpower2_write_reg | ( | usbcpower2_t * | ctx, |
| uint8_t | reg, | ||
| uint8_t | data_in ) |
USB-C Power 2 write register function.
This function writes a single byte of data to the selected writable register address.
| [in] | ctx | : Click context object. See usbcpower2_t object definition for detailed explanation. |
| [in] | reg | : Writable register address. |
| [in] | data_in | : Data byte to be written. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation.